/*
 * @(#)ConstInterceptor.java $version 2011. 10. 14
 * 
 * Copyright 2011 NHN Corp. All rights Reserved.
 * NHN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.hangame.mbl.interceptor;

import javax.servlet.http.HttpServletRequest;

import com.opensymphony.webwork.WebWorkStatics;
import com.opensymphony.xwork.ActionInvocation;
import com.opensymphony.xwork.interceptor.Interceptor;

import com.hangame.mbl.constant.CommonConst;
import com.hangame.mbl.constant.DeviceIdConst;

import com.nhncorp.lucy.web.interceptor.AbstractInterceptor;

// TODO: Auto-generated Javadoc
/**
 * The Class ConstInterceptor.
 * 
 * @author khpark
 */
public class ConstInterceptor extends AbstractInterceptor implements Interceptor, WebWorkStatics {
	
	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = -8019034670857515002L;

	//private static Log log = LogFactory.getLog(ConstInterceptor.class);

	/* (non-Javadoc)
	 * @see com.nhncorp.lucy.web.interceptor.AbstractInterceptor#intercept(com.opensymphony.xwork.ActionInvocation)
	 */
	public String intercept(ActionInvocation invocation) throws Exception {

		HttpServletRequest request = (HttpServletRequest)invocation.getInvocationContext().get(HTTP_REQUEST);
		request.setAttribute("DeviceIdConst", new DeviceIdConst());
		request.setAttribute("CommonConst", new CommonConst());

		return invocation.invoke();
	}
}
